package cn.stylefeng.guns.cloud.workflow.modular.service;

import cn.stylefeng.guns.cloud.model.page.PageResult;
import cn.stylefeng.guns.cloud.workflow.modular.model.params.DeployProcessParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import javax.xml.stream.XMLStreamException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;

/**
 * 流程部署 服务类
 *
 * @Author xuyuxiang
 * @Date 2019/11/14 14:48
 **/
public interface DeployProcessService {

    /**
     * 获取部署的流程列表
     *
     * @Author xuyuxiang
     * @Date 2019/11/14 14:50
     **/
    PageResult list(DeployProcessParam deployProcessParam, boolean isLatestVersion);

    /**
     * 删除流程
     *
     * @Author xuyuxiang
     * @Date 2019/11/14 14:51
     **/
    void delete(String deploymentId);

    /**
     * 查看已部署模型流程图
     *
     * @Author xuyuxiang
     * @Date 2019/11/14 14:51
     **/
    void viewPic(DeployProcessParam deployProcessParam, HttpServletResponse response);

    /**
     * 导出流程xml或json文件
     *
     * @Author xuyuxiang
     * @Date 2019/11/8 14:36
     **/
    void export(DeployProcessParam deployProcessParam, HttpServletResponse response);

    /**
     * 挂起
     *
     * @Author xuyuxiang
     * @Date 2019/11/17 16:32
     **/
    void suspend(String processDefinitionId);

    /**
     * 激活
     *
     * @Author xuyuxiang
     * @Date 2019/11/17 16:32
     **/
    void active(String processDefinitionId);

    /**
     * 打包下载xml和png
     *
     * @Author xuyuxiang
     * @Date 2019/11/19 11:41
     **/
    void downloadZip(String deploymentId, HttpServletResponse response) throws IOException;

    /**
     * 导入流程资源
     *
     * @Author xuyuxiang
     * @Date 2019/11/19 11:46
     **/
    void importProcess(MultipartFile file);

    /**
     * 映射模型
     *
     * @Author xuyuxiang
     * @Date 2019/11/19 11:51
     **/
    void mapping(String processDefinitionId) throws UnsupportedEncodingException, XMLStreamException;
}
